package com.matt.domain.materials;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.matt.commons.model.Model;
import java.sql.Timestamp;
import javax.persistence.*;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Cascade;

@EqualsAndHashCode(callSuper = true)
@Data
@Table(name = "materiel_record_items")
@Entity
public class MaterielRecordItems extends Model {
  /**
   * 物资记录
   */
//  @Column(name = "mrid")
//  private String mrid;

  @ManyToOne
  @JoinColumn(name = "mrid",columnDefinition = " varchar(32) COMMENT '物资记录id' ")
  @JsonIgnore
  private MaterielRecords materielRecords;

  /**
   * 物资
   */
//  @Column(name = "mid")
//  private String mid;
  @ManyToOne
  @JoinColumn(name = "mid",columnDefinition = " varchar(32) COMMENT '物资id' ")
  private Materiels materiels;

  /**
   * 数量
   */
  @Column(name = "count",columnDefinition = " int default 1 COMMENT '数量' ")
  private Integer count;

  /**
   * 状态, 1借出，2归还
   */
  @Column(name = "status",columnDefinition = " int default 1 COMMENT '对应园区id' ")
  private Integer status;

  /**
   * 创建时间
   */
  @Column(name = "created", nullable = false)
  private Timestamp created;

  
}